package cn.mymall.constant;

import java.util.Collections;
import java.util.HashMap;
import java.util.Map;

public abstract class StatusConstant {

	public static final String Y = "Y";							//对外显示或已读或已支付、卡券已发放
	public static final String DEL = "D";						//删除、卡券发放失败
	public static final String N = "N";							//对外不显示或未读或未支付 卡券未发放

	public static final String CHECK = "C";					//待审核

	////卡券状态 /////////////////////////////////////////////////////////////////////////
	/**
	 * 未激活
	 * **/
	public static final String CARD_C = "C";
	/**
	 * 有效/已激活
	 * **/
	public static final String CARD_Y = "Y";
	/**
	 * 冻结
	 * **/
	public static final String CARD_L = "L";
	/**
	 * 已使用完
	 * **/
	public static final String CARD_U = "U";
	/**
	 * 删除
	 * **/
	public static final String CARD_D = "D";
	/**
	 * 已过期
	 * **/
	public static final String CARD_E = "E";

	/**
	 * 不可用(只在查询列表时使用)
	 * **/
	public static final String CARD_N = "N";

	/** 印刷卡状态 已提取 **/
	public static final String PRINT_CARD_Y = "Y";
	/** 印刷卡状态 未提取 **/
	public static final String PRINT_CARD_N = "N";


	private static final Map<String, String> VALIDTYPE_MAP;

	public static final Map<String, String> COUPON_STATUS_DESC_MAP;
	static {
		Map<String, String> tmp = new HashMap<String, String>();
		tmp.put("Y", "Y");//可用
		tmp.put("U", "U");//已使用
		tmp.put("N", "N");//不可用(未激活,冻结,删除,过期)
		VALIDTYPE_MAP = Collections.unmodifiableMap(tmp);

		Map<String, String> tmpStatusMap = new HashMap<String, String>();
		tmpStatusMap.put(CARD_C, "未激活");
		tmpStatusMap.put(CARD_Y, "已激活");//已使用
		tmpStatusMap.put(CARD_L, "已冻结");//不可用(未激活,冻结,删除,过期)
		tmpStatusMap.put(CARD_U,"已使用完");
		tmpStatusMap.put(CARD_D,"已删除");
		tmpStatusMap.put(CARD_E,"已过期");
		tmpStatusMap.put(CARD_N,"不可用");
		COUPON_STATUS_DESC_MAP = Collections.unmodifiableMap(tmpStatusMap);

	}
	public static String getValidType(String validtype) {
		if (VALIDTYPE_MAP.containsKey(validtype))
			return VALIDTYPE_MAP.get(validtype);
		return null;
	}
}
